;(function ($) {
	//入口
	$.fn.blocks=function(options){
    	//创建对象
		var block = new myBlocks(this, options);  
		block.html();
	}
	
	//构造函数
    var myBlocks = function(ele, opt) {   	
    	//选择器对象    	
        this.$element=ele;   
        //默认参数
        this.defaults = {
    		data:[],
    		oper:"",
    		dataBack:function(){}
        },      
        //初始化参数
        this.options = $.extend({}, this.defaults, opt);
    }

    //属性方法
    myBlocks.prototype = {
    	//添加房间
    	html:function(json,i,newCol,floor){ 
    		var $this=this;
    		var $opt=$this.options;
    		
    		if($opt.oper=="jdh"){
    			var map1 = $opt.data.map(x => {

    				var	xfje=x.hasOwnProperty("xfje")?x.xfje:"";
        			var dfje=(x.hasOwnProperty("dfje")&&x.dfje>0.00)?"("+x.dfje+")":"";
        			
        			var handpanel_info={};
        			if(x.hasOwnProperty("handpanel_info")&&x.handpanel_info!="")
        				handpanel_info=JSON.parse(x.handpanel_info);
        			
        			var ico_info=[]
        			var ico_info_text="";
        			if(x.hasOwnProperty("ico_info")&&x.ico_info!="[]")
        				ico_info=JSON.parse(x.ico_info);
        			$.each(ico_info,function(key,value){ 
        				ico_info_text += getTextStyle(value); 
    				})

					var height="60px";
					if(handpanel_info.hasOwnProperty("height"))
						height=handpanel_info.height;
					var width="100px";
					if(handpanel_info.hasOwnProperty("width")) 
						width=handpanel_info.width;
					var border="";
					var defaultBorderColor="#AAAAAA"
					if(handpanel_info.hasOwnProperty("border")&&handpanel_info.border>"0"&&handpanel_info.border!="")  
						border="border: "+handpanel_info.border+"px solid "+defaultBorderColor+";";  
					var focsuColor="";
					if(handpanel_info.hasOwnProperty("focuscolor"))
						focsuColor=handpanel_info.focuscolor;

					var padding="padding: 0px;";
					if(handpanel_info.hasOwnProperty("padding")&&handpanel_info.padding!="")      
						padding="padding: "+handpanel_info.padding+"px;";
						
        			var item='<div data-default-color="'+defaultBorderColor+'" data-focus-color="'+focsuColor+'" class="box" data-body-jdh="'+x.jdh+'" data-body-th="'+x.th+'" style="'+border+' background-color:'+handpanel_info.bgcolor+';width:'+width+' !important; height:'+height+' !important; '+padding+' float:left;margin-left:5px;margin-top:5px;">'+
    						     '<div style="width: 100%;height:33%;float: left;"><span style="color:'+handpanel_info.tcolor+'">'+x.th+'</span>'+ 
    						      	'<small class="text-muted" style="color:'+handpanel_info.tcolor+' !important; font-size:60%;  float:right;">&nbsp;'+ico_info_text+ '</small>'+
    						     '</div>'+
    						     '<div style="width: 100%;height:33%;float: left;">'+ 
	 					      	 	'<span style="float:right;color:'+handpanel_info.tcolor+'">'+xfje+'</span>'+  
	 						     '</div>'+
    						     '<div style="width: 100%;height:33%;float: left;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">'+  
    						     	'<span style="float:right;color:'+handpanel_info.tcolor+'">'+dfje+'</span>'+  
    				      	 	'</div>'+
    					     '</div>'; 
        			
        			$opt.dataBack(item);  
        		});
    		}
    		$opt.workComplete();
		}
	}	
})(jQuery);